<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>投诉订单列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <style>
        #guide_ul li{
            margin-top: 5px;
        }
    </style>
</head>
<body>
<div id="aaa"></div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">投诉订单列表</div>
                <div class="layui-card-body">
                    <div class="layui-form-item layui-form">
                        {if !empty($res)}
                        <div class="layui-inline">
                            <label class="layui-form-label">订单编号</label>
                            <div class="layui-input-block">
                                <select name="order_sn" lay-verify="" lay-search id="order_sn_">
                                    <option value="">请选择</option>
                                    {foreach $res as $k=>$v}
                                    <option value="{$v['order_sn']}">{$v['order_sn']}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        {/if}
                        <div class="layui-inline">

                        </div>

                        <div class="layui-inline" >
                            <label class="layui-form-label" >投诉状态</label>
                            <div class="layui-input-block">
                                <select name="complain_status_" id="complain_status_">
                                    <option value="">全部</option>
                                    <option value="0">新投诉</option>
                                    <option value="1">已解决</option>
                                    <option value="2">未解决</option>
                                </select> </div>
                        </div>
                         <div class="layui-inline">
                          <label class="layui-form-label">投诉时间</label>
                          <div class="layui-input-inline">
                            <input type="text" class="layui-input" id="test6" placeholder="  ">
                          </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-btn-group test-table-operate-btn">
                                <button class="layui-btn" data-type="searchUserButton">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <table class="layui-hide" id="test-table-operate" lay-filter="test-table-operate">
                    </table>
                    <script type="text/html" id="test-table-operate-barDemo">
                        <a class="layui-btn layui-btn-xs" lay-event="showDetail">详细信息</a> 
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="contentShow" style="display:none;padding: 30px;">
    <p id="consultation"></p>
</div>

<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
     layui.use('laydate', function(){
      var laydate = layui.laydate;  
      //日期范围
      laydate.render({
        elem: '#test6'
        ,range: true
      }); 
    });
    layui.config({
        base: '/static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','table','laydate','set'], function(){
        $ = layui.jquery;
        var table = layui.table
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,form = layui.form;

        table.render({
            elem: '#test-table-operate'
            ,url: "{:url('Order/complainlist')}"
            ,height: 'full-100'
            ,cols: [[
                {field:'complain_id',width:80,align:'center', title: 'ID'}
                ,{field:'nickname',align:'center',title: '投诉人'}
                ,{field:'order_sn',align:'center',title: '投诉订单号'}
                ,{field:'object_name', align:'center', title: '被投诉人'}
                ,{field:'object_type', align:'center', title: '投诉类型'}
                ,{field:'complain_content', align:'center', title: '投诉内容'}
                ,{field:'create_time', align:'center', title: '投诉时间'}
                ,{field:'complain_status', align:'center', title: '状态'}
               /* ,{align:'center',width:350, title: '操作', toolbar: '#test-table-operate-barDemo'}*/
            ]]
            ,page:true
            ,limit:20
        });

        form.render(null,'component-form-group');

        laydate.render({
            elem: '#search_time'
        });



        var $ = layui.$, active = {
            addadmin: function() {
                window.location.href="{:url('Merchant/guideAdd')}";
            },
            searchUserButton:function(){
                var order_sn = $('#order_sn_').val();
                var complain_status = $('#complain_status_').val();
                var create_time = $("#test6").val();
                table.reload('test-table-operate', {
                    where: {
                        order_sn:order_sn,
                        complain_status: complain_status,
                        create_time :create_time
                    }
                    ,page: {
                        curr: 1 //重新从第 1 页开始
                    }
                });
                //return false;
            }
        };
        //绑定点击事件
        $('.test-table-operate-btn .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });

</script>


</body>
</html>